package main

import "time"

// 服务器配置
type ServerConfig struct {
	Port                  string        // 服务器端口
	ReadBufferSize        int           // 读缓冲大小
	WriteBufferSize       int           // 写缓冲大小
	ReadTimeout           time.Duration // 读超时
	WriteTimeout          time.Duration // 写超时
	PingInterval          time.Duration // Ping间隔
	MaxMessageSize        int64         // 最大消息大小
	HeartbeatTimeout      time.Duration // 心跳超时
	SessionExpireDuration time.Duration // 会话过期时间
}

// 默认服务器配置
var DefaultConfig = ServerConfig{
	Port:                  "9020",
	ReadBufferSize:        1024,
	WriteBufferSize:       1024,
	ReadTimeout:           60 * time.Second,
	WriteTimeout:          10 * time.Second,
	PingInterval:          30 * time.Second,
	MaxMessageSize:        1024 * 1024, // 1MB
	HeartbeatTimeout:      60 * time.Second,
	SessionExpireDuration: 24 * time.Hour,
}

// 获取服务器配置
func GetServerConfig() ServerConfig {
	return DefaultConfig
}
